<?php
Route::group(['middleware' => 'web', 'prefix' => 'admin', 'namespace' => 'Modules\Admin\Http\Controllers'], function()
{
    Auth::routes();
});


Route::group(['middleware' => ['web','auth:admin'], 'prefix' => 'admin', 'namespace' => 'Modules\Admin\Http\Controllers'], function()
{

    Route::get('/', 'AdminController@index');
    //资源控制器  resource permission的参数就是对resource的路由方法名字进行替换
    Route::resource('role',"RoleController")->middleware("permission:admin,resource");
//    获取权限信息
    Route::get('role/permission/{role}','RoleController@permission')->middleware("permission:admin");
//    存储权限信息
    Route::post('role/permission/{role}','RoleController@permissionStore')->middleware("permission:admin");
});


//chatgroup-route
Route::group(['middleware' => ['web','auth:admin'],'prefix'=>'admin','namespace'=>"Modules\Admin\Http\\Controllers"], function () {
    Route::resource('chatgroup', 'ChatgroupController');
});




//manage-route
Route::group(['middleware' => ['web','auth:admin'],'prefix'=>'admin','namespace'=>"Modules\Admin\Http\\Controllers"],
function () {
    Route::resource('manage', 'ManageController');
});


//chat-route
Route::group(['middleware' => ['web','auth:admin'],'prefix'=>'admin','namespace'=>"Modules\Admin\Http\\Controllers"],
    function () {
        Route::resource('chat', 'ChatController');
});
